package uc108.com.jetpackdemo.room;

import android.app.Application;

import androidx.room.Room;

public class DatabaseManager {

    static AppDatabase database;

    public static AppDatabase getAppdatabase(Application app) {
        if (database == null) {
            database = Room.databaseBuilder(app, AppDatabase.class,
                    "tcydemo-database.db")
                    .allowMainThreadQueries()
                    .build();
        }
        return database;
    }
}
